/**
 * 
 */
package com.woniuxy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.woniuxy.pojo.OGRoom;
import com.woniuxy.pojo.Order_yyh;

/**
 * @author Fz
 * @date 2019年8月10日 下午4:03:29
 * @param 
 * @return
 */
public interface CheckinMapper {
    @Select("SELECT onumber,mname,mtel,oid from `order` , member WHERE member.mid=order.mid and onumber=#{message}")
	Order_yyh getOrder(String message);
    
    @Select("Select odid,gname,checkin,checkout,rtname,orderdetail.rid from orderdetail,roomtype,guest where orderdetail.oid=#{oid} and orderdetail.gid=guest.gid and orderdetail.rtid=roomtype.rtid")
    public List<OGRoom> getOGRoom(int oid);
    
    @Select("Select rid from room where rtid=(select rtid from roomtype where rtname=#{rtname}) and rstate='可入住'")
	List<Integer> getRid(String rtname);

    @Update("update orderdetail set rid=#{rid} where odid=#{odid}")
	void updateOd(OGRoom ogroom);

    @Update("update room set rstate='已入住' where rid=#{rid} ")
	void updateRoom(OGRoom ogroom);
}
